package com.jt.flight.controller;

import com.jt.flight.domain.City;
import org.nutz.dao.QueryResult;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * since 2015/10/29.
 */

@Controller
@RequestMapping("/city")
public class CityController extends BaseController {

    @RequestMapping("/count")
    public int count() {
        return dao.count(City.class);
    }

    @RequestMapping("/list")
    public void index() {

    }

    public void add() {

    }

    @RequestMapping("/query")
    public Object query() {
        QueryResult queryResult = new QueryResult();
        List<City> ret = dao.query(City.class, null);
        queryResult.setList(ret);
        return queryResult;
    }
}
